package MultiThread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author Jimmy Zhan WORKSTATION
 * @since 2023/8/13 11:12
 * 说明：
 */

public class ExecutorThread {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        for (int i = 0; i < 10; ++i) {
            executorService.execute(new MyThread());
        }
        executorService.shutdown();
    }
}

class MyThread implements Runnable {
    @Override
    public void run() {
        System.out.println("使用线程池创建方法");
    }
}
